home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_2
/
tools.exe
/
EXAMPLES
/
GEO
/
GEMAIN.S
< prev
next >
Wrap
Text File
|
1991-07-18
|
1KB
|
27 lines
TITLE Geometry Library Main Module
INCLUDE GEROMID.H
INCLUDE GEEXTDEC.H
*****************************************************************
* The main module contains the dispatchees of the user words.
* Each routine is named with a NULLNAME compiler directive, and
* has a corresponding entry in the external declarations file.
*****************************************************************
NULLNAME GEDoACone ( %radius %height --> %area )
* Calculates the area of a cone given its radius and height
::
DUP %* OVER DUP %* ( r h^2 r^2 --> )
DUPROT %+ %SQRT ( r r^2 SQRT[r^2+h^2] --> )
ROT GEtimesPI %* ( r^2 PI*r*SQRT[r^2+h^2] --> )
SWAP GEtimesPI %+ ( %area )
;
*****************************************************************
NULLNAME GEDoVCone ( %radius %height --> %volume )
* Calculates the volume of a cone given its radius and height
::
OVER %* %*
GEtimesPI %3 %/
;
*****************************************************************